Conversation
…stments - Added an initialization script (.devcontainer/init.sh) to determine the main repository path when in a git worktree. - Updated docker-compose.yml to include a volume workaround for accessing the main repo path. - Set the entrypoint script (.devcontainer/entrypoint.sh) to be executable. - Included an initializeCommand in devcontainer.json to run the new script on container startup.
Upgrade Policy Engine and JSON Format. Improve Otel for log shipping
|
Caution Review failedThe pull request is closed. 📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (25)
WalkthroughThis PR restructures policy validation from a single withdraw rule to an array of exchange/network-scoped rules, introduces OpenTelemetry logging via LogLayer with multiple transports, adds market pattern matching and order execution resolution logic, and expands test coverage significantly. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant Helpers
participant Exchange
participant OtelLogs
Client->>Server: CreateOrder request
Server->>Helpers: resolveOrderExecution(policy, broker, cex, ...)
Helpers->>Helpers: Match market patterns<br/>against policy rules
Helpers->>Exchange: Check symbol support<br/>(direct & reverse)
Exchange-->>Helpers: Symbol availability
Helpers->>Helpers: Resolve symbol & side<br/>Apply conversion limits
Helpers-->>Server: OrderExecutionResolution<br/>(symbol, side, amountBase)
alt Resolution valid
Server->>Exchange: Execute order<br/>with resolved params
Exchange-->>Server: Order confirmation
Server->>OtelLogs: Emit order event
else Resolution invalid
Server-->>Client: INVALID_ARGUMENT error
end
Server-->>Client: Order response
sequenceDiagram
participant Application
participant LogLayer
participant TsLogTransport
participant OTelTransport
participant Outputs
Application->>LogLayer: log.info(message)
LogLayer->>TsLogTransport: Forward log record
LogLayer->>OTelTransport: Forward log record<br/>(if NODE_ENV != test)
TsLogTransport->>Outputs: Console/File output
OTelTransport->>Outputs: OTLP HTTP endpoint
Note over LogLayer: serializeError() for<br/>error objects
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores